package com.example.demo.controller;

import com.example.demo.service.UserDeviceBindingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/binding")
public class UserDeviceBindingController {

    @Autowired
    private UserDeviceBindingService bindingService;

    @PostMapping("/save")
    public String saveBinding(@RequestParam String imei, @RequestParam String openId) {
        return bindingService.saveBinding(imei, openId);
    }

    @PostMapping("/cancel")
    public String cancelBinding(@RequestParam String imei, @RequestParam String openId) {
        return bindingService.cancelBinding(imei, openId);
    }
}